

function getQq(){
	var service = {};
	var fn="getDicParam";
	service = Commonjs.jsonToString(service);
	var params = Commonjs.getParams(fn,service);//获取参数
	$.ajax({
		datatype:"json",
        type:"POST",
        url: sysurl,
        data:params,
		cache : false,
		success: function(data){
			var data=jQuery.parseJSON(data);

			if(data.result == "success"){
				var QqHtml="";
				var height = 130;
				if (data.data.dicParamList.length>0){
					for(var tt = 0; tt < data.data.dicParamList.length; tt++) {
                        if (data.data.dicParamList[tt].paramName == "comqq") {
                            var comqqText = data.data.dicParamList[tt].paramValue;
                            var strs = new Array();
                            strs = comqqText.split(",");
                            for (var i = 0; i < strs.length; i++) {
                                var subStrs = new Array();
                                var subQqlist = strs[i];
                                subStrs = subQqlist.split(":");
                                QqHtml += "<li><a target='_blank' href='http://wpa.qq.com/msgrd?v=3&uin=" + subStrs[0] + "&site=qq&menu=yes'><img border='0' src='/default/images/side_icon01.png' alt='点击这里给我发消息' title='点击这里给我发消息'/>" + subStrs[1] + "</a> </li>";
                                if (i >= 3) {
                                    break;
                                }
                            }
                        }
                    }
                    for(var tt = 0; tt < data.data.dicParamList.length; tt++) {
                        if (data.data.dicParamList[tt].paramName == "comtel") {
                            QqHtml += "<li style='border:none;'><span>电话:" + data.data.dicParamList[tt].paramValue + "</span> </li>";
                        }
                    }
                    i++;
				}
			}
			$("#qqinfo").html(QqHtml);
			height = height+38*i;
			//$(".rides-cs").css("height", height+"px");
		},
		error: function () {
        	alertNew('服务器忙，请稍候再试！');
    	}
	});
}
$(function(){
	var qqonline="";
qqonline+="	<div id='floatTools' class='rides-cs' style='height:246px;'>";
qqonline+="<div class='floatL'>";
qqonline+="	<a id='aFloatTools_Show' class='btnOpen' title='查看在线客服' style='top:20px;display:block' href='javascript:void(0);'>展开</a>";
qqonline+="	<a id='aFloatTools_Hide' class='btnCtn' title='关闭在线客服' style='top:20px;display:none' href='javascript:void(0);'>收缩</a>";
qqonline+="</div>";
qqonline+="<div id='divFloatToolsView' class='floatR' style='display: none;height:237px;width: 140px;'>";
qqonline+="  <div class='cn'>";
qqonline+="    <h3 class='titZx'>在线客服</h3>";
qqonline+="    <ul id='qqinfo'>";
qqonline+="    </ul>";
qqonline+="  </div>";
qqonline+="</div>";
qqonline+="</div>";

$("html body").append(qqonline);
	getQq();
	$("#aFloatTools_Show").click(function(){
		$('#divFloatToolsView').animate({width:'show',opacity:'show'},100,function(){$('#divFloatToolsView').show();});
		$('#aFloatTools_Show').hide();
		$('#aFloatTools_Hide').show();
	});
	$("#aFloatTools_Hide").click(function(){
		$('#divFloatToolsView').animate({width:'hide', opacity:'hide'},100,function(){$('#divFloatToolsView').hide();});
		$('#aFloatTools_Show').show();
		$('#aFloatTools_Hide').hide();
	});
});
